package dev.kaayf.examples;

import android.content.Context;
import android.util.Log;

import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.List;

import dev.kaayf.db.NoteDb;
import dev.kaayf.utils.Note;

/**
 * Instrumented test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
        assertEquals("dev.kaayf.examples", appContext.getPackageName());
    }

    @Test
    public void useSQLiteDatabase() {
//        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
//        NoteDb noteDb = new NoteDb(appContext);

//        List<Note> noteList = new ArrayList<>();
//        noteList.add(new Note("Computer", "12:21 PM"));
//        noteList.add(new Note("English", "13:21 PM"));
//        noteList.add(new Note("France", "9:21 AM"));
//        noteList.add(new Note("Math", "2:21 PM"));
//        noteList.add(new Note("Chinese", "1:20 PM"));
//        noteList.add(new Note("Uyghurs", "6:1 AM"));
//
//        for(Note item: noteList){
//            noteDb.createNote(item);
//        }

//        List<Note> queryResult = noteDb.getAllNotes();
//        for(Note item: queryResult){
//            Log.i("TEST", item.toString());
//        }

    }
}